package com.samphanie.dries.controller.rest;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Dries
 * @email 1451691457@qq.com
 */
@RestController
@RequestMapping("/api")
public class UserResource {

    @GetMapping("greeting")
    public String greeting() {
        return "Hello World";
    }

    @GetMapping("/principal")
    public Authentication getPrincipal(Authentication authentication) {
        return authentication;
    }

}
